package xmarti.vacaxm.beans.sequence;


import java.util.Date;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import xmarti.vacaxm.beans.maintenance.Animal;

// bull= toro
// cow= vaca
// calf= cria
public class Sequence implements java.io.Serializable {
    private int id;
    private Animal animal;
    private String name; 

    private Date startDate;
    private Date endDate;
    private Set<StateSequence> states = new HashSet<StateSequence>();    
    private String description; 
    private SequenceResult result;
    
    public Sequence(){}
    
    public Sequence(Animal animal, Date startDate) {
        this.animal= animal;
        this.startDate = startDate;
    }
        
    /**
     * @return the id
     */
    public int getId() {
            return id;
    }
    /**
     * @param id the id to set
     */
    public void setId(int id) {
            this.id = id;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    /**
     * @return the startDate
     */
    public Date getStartDate() {
            return startDate;
    }
    /**
     * @param startDate the startDate to set
     */
    public void setStartDate(Date startDate) {
            this.startDate = startDate;
    }
    /**
     * @return the endDate
     */
    public Date getEndDate() {
            return endDate;
    }
    /**
     * @param endDate the endDate to set
     */
    public void setEndDate(Date endDate) {
            this.endDate = endDate;
    }
   

    public Set<StateSequence> getStates() {
            return states;
    }
    /**
     * @param states the states to set
     */
    public void setStates(Set<StateSequence> states) {
            this.states = states;
    }
   
    /**
     * @return the notes
     */
    public String getDescription() {
            return this.description;
    }
    /**
     * @param notes the notes to set
     */
    public void setDescription(String notes) {
            this.description = notes;
        }

    public SequenceResult getResult() {
        return result;
    }

    public void setResult(SequenceResult result) {
        this.result = result;
    }

    public Animal getAnimal() {
        return animal;
    }

    public void setAnimal(Animal animal) {
        this.animal = animal;
    }
    

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 41 * hash + this.id;
        hash = 41 * hash + Objects.hashCode(this.animal);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Sequence other = (Sequence) obj;
        if (this.id != other.id) {
            return false;
        }
        if (!Objects.equals(this.animal, other.animal)) {
            return false;
        }        
        return true;
    }
	
	
}
